home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_1 / pubdom.tar / pubdom / rbj / dcv1 < prev    next >
Text File  |  1990-05-16  |  2KB  |  49 lines

  1. %%HP: T(3)A(D)F(.);
  2. @ Directory DCV1 - Data Card Viewer 1
  3. @     The basic concept here is that pages (cards) of text can
  4. @       nicely be stored and viewed on the 48.  This is useful
  5. @       for relatively static data.
  6. @     The basic data object would contain a string with up to 6 embedded
  7. @       newline characters and up to 22 characters between the newlines.
  8. @       The Disp function will display this on the 7 line by 22 character
  9. @       screen.  Printing is optional.  A more complex data object would
  10. @       be a list of the basic strings.
  11. @     If there are more than 7 lines, the display cleanly shows the first
  12. @       7, while the printer shows all lines.  If there are more than 22 
  13. @       characters on a line, the display shows 21 and ellipsis, while
  14. @       the printer shows more (although subject to wrap or truncation).
  15. @     Timing on a list is about  0.05 seconds per item.
  16. @ RBJ 5/15/90  Based on ideas from Bill Quinlan
  17. @     5/16/90  Revised list loop from FOR NEXT to WHILE REPEAT 
  18.  
  19. DIR
  20.   Disp \<< 
  21.     IF DEPTH                                @ Process if something on stack
  22.     THEN
  23.       CLLCD 
  24.       IF DUP TYPE 5 ==                      @ If a list
  25.       THEN DUP SIZE 1 +                     @ Get SIZE (+1 for loop)
  26.         \-> lis n \<<                       @ Empty Lists OK Here
  27.           WHILE 'n' DECR                    @ Decrementing Loop n to 1  
  28.           REPEAT lis n GET                  @ GET the Nth item
  29.           END                               @ We will now have the equivalent
  30.         \>>                                 @ of LIST-> DROP, but in reverse
  31.       END                                   @ (desired) order.
  32.       IF 9 FS? THEN PR1 END                 @ Optional Print
  33.       1 DISP 3 FREEZE                       @ Display
  34.     END 
  35.   \>>
  36.  
  37.   SAMP  {                                   @ A 2 page object
  38. "FBI     312 431-1333
  39. SecServ 312 353-5431
  40. CGuard  312 353-0278
  41. Police  911
  42. More.."
  43. "For a good time call
  44. Joan 101 555-1234"
  45. }
  46.  
  47. END
  48.  
  49.